package final2107.day06;

public class HungrySingletonTest {
    public static void main(String[] args) {
//        HungrySingleTon singleTon1 = HungrySingleTon.getInstance();
//        HungrySingleTon singleTon2 = HungrySingleTon.getInstance();
//        System.out.println(singleTon1);
//        System.out.println(singleTon2);

        Thread thread1 = new Thread(){
            @Override
            public void run() {
                HungrySingleTon singleton = HungrySingleTon.getInstance();
                System.out.println(singleton);
            }
        };

        Thread thread2 = new Thread(){
            @Override
            public void run() {
                HungrySingleTon singleton = HungrySingleTon.getInstance();
                System.out.println(singleton);
            }
        };

        thread1.start();
        thread2.start();


    }
}
